package com.bolt.admin.module.quartz.entity;

import com.bolt.support.spring.jpa.entity.BaseUuidEntity;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.util.Date;

/**
 * Auto Generate Javadoc
 *
 * @author 日期:2020-10-12 09:50:17
 *         定时任务日志
 **/
@Access(AccessType.FIELD)
@Entity
@Table(name = "sys_quartz_log")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class JobLogEntity extends BaseUuidEntity {

    /**
     * Spring Bean名称
     */
    @Column(name = "bean_name", length = 255)
    private String beanName;

    /**
     * 创建日期
     */
    @Column(name = "create_time", length = 19)
    private Date createTime;

    /**
     * cron 表达式
     */
    @Column(name = "cron_expression", length = 255)
    private String cronExpression;

    /**
     * 异常信息
     */
    @Column(name = "exception_detail", length = 65535)
    private String exceptionDetail;

    /**
     * 是否成功
     */
    @Column(name = "is_success", length = 0)
    private Boolean isSuccess;

    /**
     * 任务名称
     */
    @Column(name = "job_name", length = 255)
    private String jobName;

    /**
     * 方法名称
     */
    @Column(name = "method_name", length = 255)
    private String methodName;

    /**
     * 参数
     */
    @Column(name = "params", length = 255)
    private String params;

    /**
     * 耗时
     */
    @Column(name = "time", length = 19)
    private Long time;

    /**
     * 本次触发时间
     */
    @Column(name = "fire_time", length = 19)
    private Date fireTime;

    /**
     * 上次触发时间
     */
    @Column(name = "previous_fire_time", length = 19)
    private Date previousFireTime;

    /**
     * 下次触发时间
     */
    @Column(name = "next_fire_time", length = 19)
    private Date nextFireTime;

    /**
     * 触发次数
     */
    @Column(name = "fire_count", length = 10)
    private Integer fireCount;


}